home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1992 April / 1992-04.d64 / 1_x integrated.a < prev    next >
Text File  |  2022-09-20  |  2KB  |  3 lines

  1.  
  2.  
  3. 100 rem -- 1/x integrated --
  4. 105 print""
  5. 110 print"output to screen or printer (s/p)    s";:inputa$
  6. 115 if a$="s" then z=1.33:z1=0:z2=26.4:goto130:rem values for screen output
  7. 120 if a$<>"p" then110
  8. 125 z=1.208:z1=2.01:z2=38.24:rem values for printer output
  9. 130 screen 1:hue0,1
  10. 135 wipe
  11. 140 rem -- set up constants --
  12. 145 xt=z2:yt=100:rem sets coordinates
  13. 150 ys=0:xs=z2:rem start of divisions pn coordinates
  14. 155 ex=50*z:ey=50:rem expansion factors for x and y coordinates
  15. 160 rem -- calibrate x coordinates --
  16. 165 forx=xs to319 step5*z
  17. 170 y=yt:plotx,y:nextx
  18. 175 forx=xs to319 step10*z
  19. 180 fory=yt-1 to yt+1:plotx,y:nexty:nextx
  20. 185 forx=z2to319 step50*z
  21. 190 fory=yt-2 to yt+2:plotx,y:nexty:nextx
  22. 195 rem -- calibrate y coordinates --
  23. 200 for y=ysto199 step5
  24. 205 x=xt:plotx,y:nexty
  25. 210 for y=ys to 199 step 10
  26. 215 for x=xt-1 to xt+1:plotx,y:nextx:nexty
  27. 220 for y=ys to 199 step50
  28. 225 for x=xt-3 to xt+3:plotx,y:nextx:nexty
  29. 249 rem -- y=1/x graph & integrals of this --
  30. 250 for x=.6 to 4 step .01
  31. 260 y=1/x
  32. 270 x1=ex*x+xt:y1=ey*y+yt:plotx1,y1:nextx
  33. 280 for x=.3 to 4 step .01
  34. 290 y=log(x)
  35. 300 x1=ex*x+xt:y1=ey*y+yt:plotx1,y1:nextx
  36. 305 rem next is d[log(x)]/dx
  37. 310 for x=.01 to 4 step.01
  38. 320 y=x*(log(x)-1)
  39. 330 x1=ex*x+xt:y1=ey*y+yt:plotx1,y1:nextx
  40. 400 for y=-1.5 to 1.5 step.05
  41. 410 x=1
  42. 420 x1=ex*x+xt:y1=ey*y+yt:plotx1,y1:nexty
  43. 425 rem next is d[d[log(x)]/dx]/dx, the 2nd derivative of log(x)
  44. 430 for x=.1 to 4.3 step.02
  45. 440 y=((x^2*log(x))/2)-(3*x^2)/4
  46. 450 x1=ex*x+xt:y1=ey*y+yt:plotx1,y1:nextx
  47. 455 rem next is where x=e or 2.718..
  48. 460 for y=-1.5 to 1.5 step.05
  49. 470 x=exp(1)
  50. 480 x1=ex*x+xt:y1=ey*y+yt:plotx1,y1:nexty
  51. 999 rem -- screen or hardcopy --
  52. 1000 get a$:if a$="" then1000
  53. 1010 print "":screen 0:printchr$(14)
  54. 1020 print"hardcopy (y/n)    n";:inputa$:ifa$="n" then1080
  55. 1030 ifa$<>"y"then1010
  56. 1040 print"single or double width (s/d)    s";:inputa$
  57. 1050 ifa$="s" then poke2,1:goto1070
  58. 1060 poke2,2:ifa$<>"d"then1040
  59. 1070 screen 1:sys52224
  60. 1080 screen 0:printchr$(14):list
  61.  
  62. ready.
  63.  
  64.  
  65.